package com.example.chapter4;

import com.example.chapter4.intercept.MyInterceptor;
import com.example.chapter4.proxy.ProxyBean;
import com.example.chapter4.service.HelloService;
import com.example.chapter4.service.impl.HelloServiceImpl;

public class AopMain {
    public static void main(String[] args) {
        testProxy();
    }

    public static void testProxy(){
        HelloService helloService = new HelloServiceImpl();
        HelloService proxy = (HelloService) ProxyBean.getProxyBean(helloService, new MyInterceptor());
        proxy.sayHello("tomliy");
        System.out.println("############### name is null #########################");
        proxy.sayHello(null);
    }
}
